package org.itboys.mobile.dao.wallet;

import org.apache.ibatis.annotations.Param;
import org.itboys.mobile.entity.mysql.wallet.PearlIncomRecord;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created on 2017/10/31.
 * @author 朱坤涛
 * 收益详情情况接口
 */
public interface PearlIncomRecordMapper {
    public void delete(Long id);

    /**
     * 新增一条记录
     * @param incomeRecord
     */
    public void inster( PearlIncomRecord incomeRecord);


    /**
     * 根据参数  查询收益
     * @param param
     * @return
     */
    public BigDecimal getIncomeByMap(Map<String, Object> param);


    /**
     * 根据参数 查询列表
     * @param param
     * @return
     */
    public List<PearlIncomRecord> findListByMap(Map<String, Object> param);

    public List<PearlIncomRecord> findListByShop(Map<String, Object> param);

    /**
     * 收益详情
     * @param param
     * @return
     */
    public List<PearlIncomRecord> findRecordDetails(Map<String, Object> param);

    public PearlIncomRecord findById(Long id);

    /**
     * 根据参数  查询累积收益
     * @param param
     * @return
     */
    public BigDecimal getIncomeAmountByMap(Map<String, Object> param);

    public BigDecimal getIncomeWaitAmountByMap(Map<String, Object> param);

    /**
     * 会员的今日收益
     * @return
     */
    public BigDecimal getTodayIncomeMember(Map<String, Object> param);
    /**
     * 会员的本周收益
     * @return
     */
    public BigDecimal getWeekDayIncomeMember(Map<String, Object> param);

    /**
     * 会员的上月收益
     * @return
     */
    public BigDecimal getPreMonthIncomeMember(Map<String, Object> param);

    /**
     * 店铺的今日收益
     * @param shopId
     * @param objType
     * @return
     */
    public BigDecimal getTodayIncomeShop(@Param("shopId") Long shopId, @Param("objType") int objType);

    //用户版
    public void batchUpdate(List<Long> ids);
    //门店版
    public void batchUpdateShop(List<Long> ids);

    public void batchUpdateConfirm(List<Long> ids);

    /**
     * 查询当月收益
     * @return
     */
    public BigDecimal getMonthIncomeMember(Map<String, Object> param);

    public BigDecimal getMonthIncomeMember2(@Param("userId") Long userId);

    public void deleteByOrder(Long id);



    public List<PearlIncomRecord> getWeekDayIncomeType(@Param("userId") Long userId);

    public List<PearlIncomRecord> getMonthIncomeType(@Param("userId") Long userId);

    public List<PearlIncomRecord> getPreMonthIncomeType(@Param("userId") Long userId);
}
